{include file="public/header" /}
<title>{:lang('提现管理')}</title>
<header id="header" class="mui-bar mui-bar-nav">
    <div class="mui-pull-left PopupNavigation">
        <img src="/static/home/bl_1.png" alt="">
    </div>
    <h1 class="mui-title">{:lang('提现管理')}</h1>
    <div class="mui-pull-right" style="display: none;">
        <div class="mui-switch mui-active" >
            <div class="mui-switch-handle"></div>
        </div>
    </div>
</header>    

{include file="public/menu" /}<div id="pullrefresh" class="mui-content mui-scroll-wrapper" data-scroll="1">
<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
    <div class="mui-scroll" style="padding-top:44px">
        <div class="df withdNavBox">
            <div class="fx1 withdNav likeA" data-url="{:url('Carry/carryAdd')}">收益提现</div>
            <div class="fx1 withdNav likeA" data-url="{:url('Carry/carryAddPrincipal')}">本金提现</div>
            <div class="fx1 withdNav withdNavActive">{:lang('收益转筹码')}</div>
        </div>
        <div class="accumutzBox">
            <div class="accumutzTx">{:lang('可转收益')}</div>
            <div class="accumutzShu">$ {$user.profit}</div>
        </div>
        <form id="subForm">
            <div class="withdinputBox">
                <div class="withdinputhe">
                    <input type="number" name="money" autocomplete="off" placeholder="{:lang('请输入可转金额 单位:美元')}">
                </div>
                <div class="applicaageAnbox">
                    <button class="applicaageAn subForm" type="button">{:lang('确认转换')}</button>
                </div>
            </div>
                {:token('__hash__')}
        </form>
        <div class="staataBox">
            <div class="staataTl">{:lang('收益转筹码记录')}</div>
            <div class="staataTableBox">
                <table class="tabletada" border="0" cellspacing="" cellpadding="">
                    <thead>
                    <tr>
                        <th>{:lang('提交时间')}</th>
                        <th>{:lang('转换金额')}</th>
                    </tr>
                    </thead>
                    <tbody id="content">

                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script src="/static/home/echarts.min.js" type="text/javascript" charset="utf-8"></script>
<script>
    mui('.mui-scroll-wrapper').scroll({
        deceleration: 0.0005
    });
    $('input[name="money"]').on('blur keyup', jsMoney);
    function jsMoney()
    {
        var money = $('input[name="money"]').val() * 6.8;

        $('#showMoney').html(money);
    }
    var mask=mui.createMask(),isSub = true;
    mui('body').on('tap', '.subForm', function() {
        var obj = $(this);
        if(isSub) {
            isSub = false;
            var data = $('#subForm').serialize();
            var url = "{:url('transformAdd')}";
            mui.showLoading("提交中","div");
            mask.show();//显示遮罩层
            $.post(url, data, function(data) {
                mask.close();//关闭遮罩层
                mui.hideLoading();
                if(data.status == 0) {
                    isSub = true;
                    mui.toast(data.msg, {
                        duration: 'long',
                        type: 'div'
                    });
                } else if(data.status == 1) {
                    mui.toast(data.msg, {
                        duration: '2000',
                        type: 'div'
                    });
                    window.location.reload();
                }
            });
        }
    });
    $(document).ready(function () {
        ajaxGetContent();
    });
    var page = 0,stop = true;

    function ajaxGetContent() {
        if (stop == true || page == 0) {
            stop = false;
            if (page == 0) {
                $('#content').html('');
            }

            $.ajax({
                type: "GET",
                url: "{:url('carry/carry_log')}",//+tab,
                data: {p: page},
                success: function (data) {
                    page += 1;
                    $('.loadAdd').hide();
                    if ($.trim(data) == '') {
                        stop = false;
                        if (page >= 2) {
                            $('.loadAdd_bottom').show();
                        } else if (page == 1) {
                            $('.loadAdd_nodata').show();
                        }
                    } else {
                        stop = true;
                        let html = '';
                        for(var i = 0;i<data.list.length;i++){
                            html += '<tr><td>'+data.list[i].created+'</td>';
                            html += '<td>'+data.list[i].num+'</td>';
                            html += '</tr>';
                        }
                        $('#content').append(html);
                    }
                }, error: function () {
                    mui.toast('网络失败，请刷新后重试', {duration: 'long', type: 'div'})
                }
            });
        }
    }
</script>


</body></html>